package com.hyk.commonLib.common.utils.dataBinding.bindingAdapter;

import android.view.View;

import androidx.databinding.BindingAdapter;

/**
 * Created by 贺玉琨 on 2020/7/21.
 */
public class VisibilityAdapter {
    @BindingAdapter("show")
    public static void setShow(View view, boolean show) {
        view.setVisibility(show ? View.VISIBLE : View.GONE);
    }

    @BindingAdapter("hide")
    public static void setHide(View view, boolean hide) {
        view.setVisibility(hide ? View.INVISIBLE : View.VISIBLE);
    }

    @BindingAdapter("gone")
    public static void setGone(View view, boolean gone) {
        view.setVisibility(gone ? View.GONE : View.VISIBLE);
    }
}
